﻿using System;
using System.Net;
using System.ComponentModel.Composition.Hosting;
using System.ComponentModel.Composition.Primitives;

namespace Urb.Weather.Ticker.Composition
{
    public class PreconfiguredCatalog
    {
        public ComposablePartCatalog Catalog
        {
            get
            {
                var catalog = new AggregateCatalog();

                catalog.Catalogs.Add(new AssemblyCatalog(typeof(Urb.Weather.Core.IModule).Assembly));
                catalog.Catalogs.Add(new AssemblyCatalog(typeof(Urb.Weather.Container.Unity.UnityContainerModule).Assembly));
                catalog.Catalogs.Add(new AssemblyCatalog(typeof(Urb.Weather.Engine.EngineModule).Assembly));
                catalog.Catalogs.Add(new AssemblyCatalog(typeof(Urb.Weather.Manager.ManagerModule).Assembly));
                catalog.Catalogs.Add(new AssemblyCatalog(typeof(Urb.Weather.Yahoo.YahooWeatherDataProviderModule).Assembly));
                catalog.Catalogs.Add(new AssemblyCatalog(typeof(Urb.Weather.Ticker.Configuration.Preconfigured.ConfigurationModule).Assembly));
                catalog.Catalogs.Add(new AssemblyCatalog(typeof(Urb.Weather.Ticker.UI.UIModule).Assembly));

                return catalog;
            }
        }
    }
}
